package arrayListDemo;

import java.util.ArrayList;

public class Demo2 {
	public static void main(String args[]){
		ArrayList arrayList = new ArrayList();
		arrayList.add(new Car(1, "bmw"));
		arrayList.add(new Car(2, "f1"));
		arrayList.add(new Car(3, "oooo"));
		System.out.println(arrayList);
		Car car = new Car(3, "oooo");
		//比较一个对象是否在arraylist中
		//contains(obj)：内部其实就是自动调用obj当中的equals方法
		System.out.println(arrayList.contains(car));
	}
}
